#include "VStdAfx.h"
#include "VSceneNode.h"


VSceneNode::VSceneNode(void)
{
}


VSceneNode::~VSceneNode(void)
{
}

void VSceneNode::AttachChild(VSceneObject* Entity)
{
	VASSERT(Entity && !HasChild(Entity));
	VSceneNode* ParentNode = Entity->GetParent();
	if (ParentNode)
	{
		ParentNode->DettachChild(Entity);
	}

	m_Childs.PushBack(Entity);
	Entity->OnAttachTo(this);
}

void VSceneNode::DettachChild(VSceneObject* Entity)
{

}

void VSceneNode::OnTransformDirty()
{
	for (UINT ChildIndex = 0; ChildIndex < m_Childs.Size(); ++ ChildIndex)
	{
		m_Childs[ChildIndex]->OnTransformDirty();
	}
}

